package com.linln.modules.member.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;

import com.linln.common.enums.DayEnum;
import com.linln.common.enums.StatusEnum;
import com.linln.common.enums.TypeEnum;
import com.linln.common.utils.StatusUtil;
import com.linln.modules.member.domain.MemberInfo;

import lombok.Data;

/**
  * 拒绝退款记录表
 * @author hct
 * @date 2019/09/12
 */
@Data
@Entity
@Table(name="member_refund")
@EntityListeners(AuditingEntityListener.class)
public class MemberRefund implements Serializable {
    // 主键ID
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long id;
    // 所属城市
    private String area;
    //订单编号
    private String orderCode;
    //订单编号
    private String refundCode;
    
    // 所属类型
    private Integer type;
    @Transient
    private String typeValue;
    public String getTypeValue() {
		return TypeEnum.getVal(type); 
	}
    // 所属类型id
    private Long typeId;
    //信息
    private String content;
    //总费用
    private Double money;
    //退款费用
    private Double refundmoney;    
    //支付状态  0是待退款 1是已退款
    private Integer refundStatus;        
    // 用户id
    //private Long memberId;
    @ManyToOne(fetch=FetchType.LAZY)
    @NotFound(action=NotFoundAction.IGNORE)
    @JoinColumn(name="member_id")
    private MemberInfo member;
    
    //对应代理商
    private Long agentId;
    
    // 创建时间
    @CreatedDate
    private Date createDate;
   
}